{literal}
<script type="text/javascript">
jQuery(function($) {
	// Checkbox durch Klick auf Tabellenzeile markieren
	$('table.acp-table tr').filter(':has(:checkbox:checked)').addClass('selected').end().click(function(event) {
		if (event.target.type !== 'checkbox') {
			$(':checkbox', this).trigger('click');
		}
	}).find(':checkbox').click(function() {
		$(this).parents('tr:first').toggleClass('selected');
	});
{/literal}
	$('form .acp-table').after('<' + 'div class="mark-entries"><' + 'a href="javascript:mark_entries(\'{$checkbox_name}\',\'add\')">{lang values="common|mark_all"}<' + '/a> <' + 'span>::<' + '/span> <' + 'a href="javascript:mark_entries(\'{$checkbox_name}\',\'remove\')">{lang values="common|unmark_all"}<' + '/a><' + '/div>');
{literal}
	$('form #adm-list input[type=image]').click(function() {
		var entries = $('form .acp-table input:checkbox:checked') || [];
		var ary = '';

		jQuery.each(entries, function() {
			ary = ary + $(this).val() + '|';
		});

		$('div.mark-entries').after('<' + 'div id="dialog"><' + 'h5 style="text-align:center"><' + '/h5><' + '/div>');

		if (ary != '') {
			$('#dialog h5').text('{/literal}{lang values="common|confirm_delete"}{literal}');
			$('#dialog').dialog({
				draggable: false,
				resizable : false,
				modal: true,
				overlay: {
					backgroundColor: '#000',
					opacity: 0.5
				},
				buttons: {
					{/literal}{lang values="common|no"}{literal}: function() {
						$(this).dialog('close');
					},
					{/literal}{lang values="common|yes"}{literal}: function() {
						location.href = $('.acp-table').parent('form').attr('action') + 'entries_' + ary.substr(0, ary.length - 1) + '/confirmed_1/';
					}
				}
			});
		} else {
			$('#dialog h5').text('{/literal}{lang values="common|no_entries_selected"}{literal}');
			$('#dialog').dialog({
				draggable: false,
				resizable : false,
				modal: true,
				overlay: {
					backgroundColor: '#000',
					opacity: 0.5
				}
			});
		}
		return false;
	});
});
</script>
{/literal}